//
//  CXLDetailsModel.m
//  WYNews
//
//  Created by 夜猫子 on 2017/3/18.
//  Copyright © 2017年 夜猫子. All rights reserved.
//

#import "CXLDetailsModel.h"

@implementation CXLDetailsModel

+ (NSArray *)topicDataList{
    
    NSURL *strURL = [[NSBundle mainBundle] URLForResource:@"topic_news.json" withExtension:nil];
    
    NSData *data = [NSData dataWithContentsOfURL:strURL];
    
    NSDictionary *dict = [NSJSONSerialization JSONObjectWithData:data options:0 error:NULL];
    
    NSArray *dicArr = dict[@"tList"];
    
    NSArray *arr = [NSArray yy_modelArrayWithClass:[CXLDetailsModel class] json:dicArr];
    
    arr = [arr sortedArrayUsingComparator:^NSComparisonResult(CXLDetailsModel *obj1, CXLDetailsModel *obj2) {
        
        return [obj1.tid compare:obj2.tid];
    }];
    
    return arr;
    
}

@end
